package com.accesshollywood.indexables;


public class GraphicType extends Indexed {
	protected String	name;
	protected String	prefix;
	protected ShowName	showName;

	@Override
	public void initSQL() {
		setThat(this);
		tableName = "graphicType";
		idColumnName = "idGraphicType";

		elementColumnName.put(getField("name"), "name");
		elementColumnName.put(getField("prefix"), "prefix");
		elementColumnName.put(getField("showName"), "idShowName");
	}


	
	public String toString(){
		return name.toString();
	}
	
	public synchronized String getName() {
		return name;
	}

	public synchronized void setName(String name) {
		this.name = name;
	}

	public synchronized String getPrefix() {
		return prefix;
	}

	public synchronized void setPrefix(String prefix) {
		this.prefix = prefix;
	}

	public synchronized ShowName getShowName() {
		return showName;
	}

	public synchronized void setShowName(ShowName showName) {
		this.showName = showName;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = super.hashCode();
		result = prime * result + ((name == null) ? 0 : name.hashCode());
		result = prime * result + ((prefix == null) ? 0 : prefix.hashCode());
		result = prime * result + ((showName == null) ? 0 : showName.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (!super.equals(obj))
			return false;
		if (getClass() != obj.getClass())
			return false;
		GraphicType other = (GraphicType) obj;
		if (name == null) {
			if (other.name != null)
				return false;
		} else if (!name.equals(other.name))
			return false;
		if (prefix == null) {
			if (other.prefix != null)
				return false;
		} else if (!prefix.equals(other.prefix))
			return false;
		if (showName == null) {
			if (other.showName != null)
				return false;
		} else if (!showName.equals(other.showName))
			return false;
		return true;
	}

}
